<template>
	<div class="zBox">
		<div class="title">
			<span>{{ projectName }}</span>
		</div>
		<el-table class="qjTable" v-loading="loading" :data="tableList" stripe height="600">
			<el-table-column prop="createTime" label="时间" align="center"></el-table-column>
			<el-table-column prop="msg" label="操作内容" align="center"></el-table-column>
			<el-table-column prop="createBy" label="操作人" align="center"></el-table-column>
		</el-table>
		<pagination class="pagination" v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getProgress" />
	</div>
</template>

<script setup>
import {getProjectOperList } from '@/api/hkd';
import useUserStore from '@/store/modules/user';
import { ElMessage, ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance();
const projectId = ref('');
const projectName = ref('');
const progressList = ref({});
const total = ref(0);
const loading = ref(true);
const tableList = ref([]);
const data = reactive({
	queryParams: {
		pageNum: 1,
		pageSize: 10
	},
});

const { queryParams } = toRefs(data);

onMounted(() => {
	if (proxy.$route.query) {
		projectId.value = proxy.$route.query.projectId;
		projectName.value = proxy.$route.query.projectName;
		getProgress()
	}
});
function getProgress() {
	queryParams.value.projectId = projectId.value
	getProjectOperList(queryParams.value).then(res => {
		if (res.code === 200) {
			tableList.value = res.rows;
			total.value = res.total;
			loading.value = false;
		} else {
			ElMessage({ message: res.msg, type: 'error', duration: 1 * 1000 });
		}
	});

}
</script>

<style lang="scss" scoped>
.zBox {
	height: 99.8%;
	background-color: #ffffff;
	border-radius: 10px;
	padding: 20px;
}
:deep(.qjTable)  {
	.el-table__header-wrapper,
	.el-table__fixed-header-wrapper {
		th {
			word-break: break-word;
			background-color: #f7f7f7 !important;
			color: #515a6e;
			height: 58px !important;
			font-size: 13px;
			border: none !important;
		}
	}
	.el-table__body-wrapper {
		.el-button [class*='el-icon-'] + span {
			margin-left: 1px;
		}
		.el-table__row {
			td {
				border: none !important;
				height: 54px;
			}
		}
	}
}
.title {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 20px;
	padding:9px 0;
}
</style>
